package com.szqhyxj.youxiangju.sys;

import java.util.concurrent.TimeUnit;

import okhttp3.OkHttpClient;
import retrofit2.Retrofit;

/**
 * XiaoPanYu
 * on 2018/11/13
 */
public class RetrofitDownload {

    public static Retrofit getRetrofit(String url) {
        OkHttpClient okHttpClient = new OkHttpClient.Builder()
                .connectTimeout(180, TimeUnit.SECONDS)
                .readTimeout(180, TimeUnit.SECONDS)
                .writeTimeout(180, TimeUnit.SECONDS)
                .build();
        return new Retrofit
                .Builder()
                .baseUrl(url)
                .client(okHttpClient)
                .build();
    }

}